package com.leyantech.ecp.agenx.translator.filter.dialog;

import com.leyantech.ai.DialogueReply;
import com.leyantech.ai.ServiceType;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import lombok.extern.slf4j.Slf4j;

import java.util.function.Predicate;

/**
 * @author eahau, {@literal <eahau@foxmail.com>}
 * @date 2022-11-15.
 */
@Slf4j
@Singleton
public class DialogueReplyFilter implements Predicate<DialogueReply> {

  @Inject
  public DialogueReplyFilter() {
  }

  @Override
  public boolean test(DialogueReply dialogueReply) {
    // 只回复问答，忽略 takeAction
    return dialogueReply.getServiceType() != ServiceType.TAKE_ACTION;
  }

}
